﻿using System.ComponentModel;

namespace JustTypeUI.Logic
{
    /// <summary>
    /// Feedback message to be shown to the user
    /// 
    /// Main Author: Peng Jun
    /// </summary>
    public class Feedback : INotifyPropertyChanged
    {
        private string feedbackMessage;
        public string FeedbackMessage
        {
            get
            {
                return feedbackMessage;
            }
            set
            {
                feedbackMessage = value;
                OnPropertyChanged("FeedbackMessage");
            }
        }

        public Feedback()
        {
            feedbackMessage = "";
        }
        
        public override string ToString()
        {
            return feedbackMessage;
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }

        #endregion
    }
}
